<template>
  <view class="empty-block">
    <image :src="src" mode="aspectFill" :style="{ 'margin-top': marginTop + 'rpx' }"></image>
    <text class="tip">{{ text }}</text>
  </view>
</template>

<script>
  export default {
    props: {
      type: {
        type: String,
        default: 'default', // auth、default、network
      },
      text: {
        type: String,
        default: '没有数据',
      },
      marginTop: {
        type: [String, Number],
        default: 100,
      },
    },
    data() {
      return {
        tip: '',
        src: '/static/images/empty/' + this.type + '.png',
      }
    },
  }
</script>

<style scoped lang="less">
  .empty-block {
    padding-top: 1px;
    text-align: center;

    image {
      display: block;
      margin: 0 auto;
      width: 212rpx;
      height: 212rpx;
      margin-bottom: 32rpx;
    }

    .tip {
      font-size: 28rpx;
      font-weight: 400;
      color: #9ea5bb;
      line-height: 44rpx;
    }
  }
</style>
